package com.halko.PR.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

/**
 * @author halko
 * @create 2021-04-08 16:49
 */
@Configuration
public class DemoWebConfig {
    /**
     * 拦截器配置
     *
     * @param registry
     */
    public void addInterceptors(InterceptorRegistry registry) {
        //添加拦截器
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/api/**")
                //放行路径，可以添加多个
                .excludePathPatterns("/api/login");
    }
}
